home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Modules / BackSpaceModules / Source / FlippyFloppy / FlippyFloppyWraps.psw < prev    next >
Text File  |  1992-12-07  |  1KB  |  51 lines

  1. /* 
  2.  
  3. FlippyFloppyWraps.psw
  4.  
  5. Wraps for this funky thing.
  6.  
  7.  Copyright (c) 1992 by Scott Byer
  8.  
  9.  Permission is given to freely distribute and modify this code
  10.  provided the copyright notice is left unchanged.
  11.  No warranties, explicit or implied, apply to this code.
  12. */
  13.  
  14.   /* Zero out the cache limit for this context, return the old value. */
  15. defineps FFWzerocachelimit( | int *cacheLimit)
  16.     cachestatus cacheLimit clear
  17.     0 setcachelimit
  18. endps
  19.  
  20. defineps FFWsetcachelimit(int cacheLimit)
  21.     cacheLimit setcachelimit
  22. endps
  23.  
  24.   /*  Get the path bounding box for a line of text. */
  25. defineps FFWTextBBox( char *someText | double *llx, *lly, *urx, *ury )
  26.     newpath 
  27.     0 0 moveto (someText) false charpath 
  28.     flattenpath pathbbox 
  29.         ury urx lly llx
  30. endps
  31.  
  32.   /* Transform the coordinate system */
  33. defineps FFWTransform(double tx, ty, sx, sy, r)
  34.     tx ty translate sx sy scale r rotate
  35. endps
  36.  
  37.   /* Reverse transform things, if given the right inputs. */
  38. defineps FFWDeTransform(double tx, ty, sx, sy, r)
  39.     r rotate sx sy scale tx ty translate
  40. endps
  41.  
  42.   /* Draw a single black rectangle. */
  43. defineps FFWBlackBox(double llx, lly, width, height)
  44.     0 setgray
  45.     llx lly width height rectfill
  46. endps
  47.  
  48.   /* Draw text at a given location; the font must already be set. */
  49. defineps FFWText(double x, y; char *text)
  50.     x y moveto (text) show
  51. endps